<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>3dchess: StateMachine Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3dchess
   </div>
   <div id="projectbrief">Basic chess application with OpenGL graphics and AI</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="class_state_machine-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">StateMachine Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Class which manages the states.  
 <a href="class_state_machine.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_state_machine_8h_source.html">StateMachine.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_state_machine_1_1_event_map.html">EventMap</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure for holding user events.  <a href="struct_state_machine_1_1_event_map.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad7b9c9898d81930ae010a7e1116f90b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#ad7b9c9898d81930ae010a7e1116f90b7">setStartState</a> (<a class="el" href="class_abstract_state.html">AbstractState</a> *startState)</td></tr>
<tr class="memdesc:ad7b9c9898d81930ae010a7e1116f90b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the start state and setup the state.  <a href="#ad7b9c9898d81930ae010a7e1116f90b7">More...</a><br/></td></tr>
<tr class="separator:ad7b9c9898d81930ae010a7e1116f90b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7a35a5e8d8b9a54de0fbe167f6fb3be"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_abstract_state.html">AbstractState</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#ac7a35a5e8d8b9a54de0fbe167f6fb3be">run</a> ()</td></tr>
<tr class="memdesc:ac7a35a5e8d8b9a54de0fbe167f6fb3be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Runs the current state.  <a href="#ac7a35a5e8d8b9a54de0fbe167f6fb3be">More...</a><br/></td></tr>
<tr class="separator:ac7a35a5e8d8b9a54de0fbe167f6fb3be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a471eec25e55ac65fb8f1d1faccdd8a0e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#a471eec25e55ac65fb8f1d1faccdd8a0e">setNextState</a> (<a class="el" href="class_abstract_state.html">AbstractState</a> *state)</td></tr>
<tr class="memdesc:a471eec25e55ac65fb8f1d1faccdd8a0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the next state which should be run.  <a href="#a471eec25e55ac65fb8f1d1faccdd8a0e">More...</a><br/></td></tr>
<tr class="separator:a471eec25e55ac65fb8f1d1faccdd8a0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a84001b7d1367a7d3e08beff4978d0fbc"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_state_machine.html">StateMachine</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#a84001b7d1367a7d3e08beff4978d0fbc">getInstance</a> ()</td></tr>
<tr class="memdesc:a84001b7d1367a7d3e08beff4978d0fbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets an instance of the <a class="el" href="class_state_machine.html" title="Class which manages the states. ">StateMachine</a>.  <a href="#a84001b7d1367a7d3e08beff4978d0fbc">More...</a><br/></td></tr>
<tr class="separator:a84001b7d1367a7d3e08beff4978d0fbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a5dab1a44f1479ebfcab4924924024d38"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5dab1a44f1479ebfcab4924924024d38"></a>
struct <a class="el" href="struct_state_machine_1_1_event_map.html">StateMachine::EventMap</a>&#160;</td><td class="memItemRight" valign="bottom"><b>eventmap</b></td></tr>
<tr class="separator:a5dab1a44f1479ebfcab4924924024d38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe0e969eda7a466b975dfb1b74b5471a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afe0e969eda7a466b975dfb1b74b5471a"></a>
<a class="el" href="class_gui_window.html">GuiWindow</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#afe0e969eda7a466b975dfb1b74b5471a">window</a></td></tr>
<tr class="memdesc:afe0e969eda7a466b975dfb1b74b5471a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Holds the pointer to the <a class="el" href="class_gui_window.html" title="This class is a wrapper which holds the window with the OpenGL context. ">GuiWindow</a> object, to access gui related methods. <br/></td></tr>
<tr class="separator:afe0e969eda7a466b975dfb1b74b5471a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a2fb07002510ea9141019559750acfab8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2fb07002510ea9141019559750acfab8"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#a2fb07002510ea9141019559750acfab8">StateMachine</a> ()</td></tr>
<tr class="memdesc:a2fb07002510ea9141019559750acfab8"><td class="mdescLeft">&#160;</td><td class="mdescRight">For singleton reasons no public constructor. <br/></td></tr>
<tr class="separator:a2fb07002510ea9141019559750acfab8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac20281d5bff4a2b72826b7f2a771f066"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac20281d5bff4a2b72826b7f2a771f066"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>StateMachine</b> (const <a class="el" href="class_state_machine.html">StateMachine</a> &amp;)</td></tr>
<tr class="separator:ac20281d5bff4a2b72826b7f2a771f066"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08524897f33997f5b384c51e367f78fb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08524897f33997f5b384c51e367f78fb"></a>
<a class="el" href="class_state_machine.html">StateMachine</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="class_state_machine.html">StateMachine</a> &amp;)</td></tr>
<tr class="separator:a08524897f33997f5b384c51e367f78fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:aa17ce82e8c33da11cc2fe980bcf29fa7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa17ce82e8c33da11cc2fe980bcf29fa7"></a>
<a class="el" href="class_abstract_state.html">AbstractState</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_machine.html#aa17ce82e8c33da11cc2fe980bcf29fa7">m_currentState</a></td></tr>
<tr class="memdesc:aa17ce82e8c33da11cc2fe980bcf29fa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">The current state. <br/></td></tr>
<tr class="separator:aa17ce82e8c33da11cc2fe980bcf29fa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Class which manages the states. </p>
<dl class="section note"><dt>Note</dt><dd>This is a singleton, you can get only one instance of the <a class="el" href="class_state_machine.html" title="Class which manages the states. ">StateMachine</a>. Don't forget to update the events if they occur. </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a84001b7d1367a7d3e08beff4978d0fbc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_state_machine.html">StateMachine</a>&amp; StateMachine::getInstance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets an instance of the <a class="el" href="class_state_machine.html" title="Class which manages the states. ">StateMachine</a>. </p>
<dl class="section note"><dt>Note</dt><dd>This is a singleton. So you can only get one instance. </dd></dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_state_machine.html" title="Class which manages the states. ">StateMachine</a>&amp; A reference to the <a class="el" href="class_state_machine.html" title="Class which manages the states. ">StateMachine</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="ac7a35a5e8d8b9a54de0fbe167f6fb3be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_abstract_state.html">AbstractState</a> * StateMachine::run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Runs the current state. </p>
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="class_abstract_state.html" title="Interface for modelling a game state. ">AbstractState</a> pointer to the state which must be <a class="el" href="class_state_machine.html#ac7a35a5e8d8b9a54de0fbe167f6fb3be" title="Runs the current state. ">run()</a> the next time. </dd></dl>

</div>
</div>
<a class="anchor" id="a471eec25e55ac65fb8f1d1faccdd8a0e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateMachine::setNextState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_abstract_state.html">AbstractState</a> *&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the next state which should be run. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td>The next state. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad7b9c9898d81930ae010a7e1116f90b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateMachine::setStartState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_abstract_state.html">AbstractState</a> *&#160;</td>
          <td class="paramname"><em>startState</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the start state and setup the state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">startState</td><td>The start state. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>S:/dev/3dchess/src/gui/<a class="el" href="_state_machine_8h_source.html">StateMachine.h</a></li>
<li>S:/dev/3dchess/src/gui/StateMachine.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Mar 9 2014 23:13:01 for 3dchess by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
